<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/classes/DBHelper.class.jsp"%>
<%@ include file="/classes/CommonHelper.class.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("basePath", basePath);
%>

<%
	//获取数据
	String qa_id = request.getParameter("qa_id");
	String sql = "SELECT * FROM APP_QA t WHERE t.qa_id = ?";
	Map<String, Object> qa = getObject(sql, new Object[]{qa_id});
	pageContext.setAttribute("qa", qa);
%>
<!DOCTYPE html>
<html>
<head>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>问答系统-后台管理</title>

<%-- <script type='text/javascript' src="${basePath }plugins/jquery/jquery-1.12.2.min.js"></script> --%>
<link rel="stylesheet" href="${basePath }plugins/layui/v1.0.9/css/layui.css" media="all">
<style type="text/css">
.question, .answer {
	overflow: hidden;
	width: 350px;
	display: inline-block;
	text-overflow: ellipsis;
	white-space: nowrap;
}

th {
	background-color: #f2f2f2;
}
</style>
</head>
<body>
	<table class="layui-table" style="width: 95%; margin: 10px auto;">
		<tr>
			<th width="150">问题</th>
			<td>${qa.question }</td>
		</tr>
		<tr>
			<th width="150">提问者</th>
			<td>${qa.question_name }</td>
		</tr>
		<tr>
			<th width="150">手机号码</th>
			<td>${qa.phone }</td>
		</tr>
		<tr>
			<th>提交时间</th>
			<td>
				<fmt:formatDate value="${qa.create_time }" pattern="yyyy-MM-dd HH:mm:ss" />
			</td>
		</tr>
		<tr>
			<th>当前状态</th>
			<td>
				<c:if test="${qa.status eq 'A' }">未答复</c:if>
				<c:if test="${qa.status eq 'B' }">已答复</c:if>
				<c:if test="${qa.status eq 'C' }">未通过</c:if>
			</td>
		</tr>
		<c:if test="${qa.status ne 'A' }">
			<tr>
				<th>答复内容</th>
				<td>${qa.answer }</td>
			</tr>
			<tr>
				<th>答复时间</th>
				<td>
					<fmt:formatDate value="${qa.answer_time }" pattern="yyyy-MM-dd HH:mm:ss" />
				</td>
			</tr>
		</c:if>
	</table>
	<script type="text/javascript" src="${basePath }plugins/layui/v1.0.9/layui.js"></script>
	<script type='text/javascript'>
		// 		layui.use('form', function() {
		// 			var $ = layui.jquery, form = layui.form();

		// 			//全选
		// 			form.on('checkbox(allChoose)', function(data) {
		// 				var child = $(data.elem).parents('table').find(
		// 						'tbody input[type="checkbox"]');
		// 				child.each(function(index, item) {
		// 					item.checked = data.elem.checked;
		// 				});
		// 				form.render('checkbox');
		// 			});

		// 		});
	</script>
</body>
</html>